SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 42986: The SAS® PC Files Server does not support environment variables in the DATAFILE= option

DetailsAboutRate It

The SAS PC Files Server does not recognize environment variables in the DATAFILE= option when you use the EXCELCS and ACCESSCS engines. Consider the following example:

options set=mapping "C:\sastest";
proc import dbms=excelcs out=fred
            datafile="!mapping\marty.xlsb" replace;
   sheet='Marty1';
run;

When you submit a procedure similar to the one above, the following error is generated:

ERROR: Unable to open file !mapping\marty.xlsb. It does not  exist or it is already opened
       exclusively by another user, or you need permission to view its data.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.49 seconds
      cpu time            0.01 seconds

The code in the previous example works when you use the EXCEL engine. The problem occurs when you use the EXCELCS or the ACCESSCS engines because these engines do not support this feature.

To circumvent the problem, use a macro variable in the DATAFILE= option, as shown below:

%let mapping2=c:\sastest;
proc import dbms=excelcs out=fred
            datafile="&mapping2\marty.xlsb" replace;
   sheet='Marty1';
run;


Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/ACCESS Interface to PC FilesMicrosoft Windows Server 2003 Enterprise Edition9.2 TS2M09.4 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.2 TS2M09.4 TS1M0
Microsoft Windows XP 64-bit Edition9.2 TS2M09.4 TS1M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.2 TS2M09.4 TS1M0
Microsoft Windows Server 2003 Standard Edition9.2 TS2M09.4 TS1M0
Microsoft Windows Server 2008 for x649.2 TS2M09.4 TS1M0
Windows Vista for x649.2 TS2M09.4 TS1M0
Microsoft® Windows® for x649.2 TS2M29.4 TS1M0
Microsoft Windows Server 2003 for x649.2 TS2M29.4 TS1M0
Windows 7 Enterprise x649.2 TS2M2
Windows 7 Home Premium x649.2 TS2M2
Windows 7 Professional x649.2 TS2M2
Windows 7 Ultimate x649.2 TS2M2
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.